﻿<UserControl x:Class="BootyBay.PrivateStoreApp.Controls.MainPageFlipViewControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="using:BootyBay.PrivateStoreApp.Controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:common="using:BootyBay.PrivateStoreApp.Common">
    <UserControl.Resources>
        <common:BorderMenuConverter x:Key="BorderMenuConverter"></common:BorderMenuConverter>
        <common:IsShowDefaultPicConverter x:Key="IsShowDefaultPicConverter"></common:IsShowDefaultPicConverter>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="245"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="15"></ColumnDefinition>
            <ColumnDefinition Width="700"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Column="0" Grid.Row="1" Orientation="Vertical">
            <Border Height="15" Width="4" Background="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource BorderMenuConverter},ConverterParameter=0}"></Border>
            <Border Height="5" Width="1" Background="#00FFFFFF"></Border>
            <Border Height="15" Width="4" Background="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource BorderMenuConverter},ConverterParameter=1}"></Border>
            <Border Height="5" Width="1" Background="#00FFFFFF"></Border>
            <Border Height="15" Width="4" Background="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource BorderMenuConverter},ConverterParameter=2}"></Border>
            <Border Height="5" Width="1" Background="#00FFFFFF"></Border>
            <Border Height="15" Width="4" Background="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource BorderMenuConverter},ConverterParameter=3}"></Border>
            <Border Height="5" Width="1" Background="#00FFFFFF"></Border>
            <Border Height="15" Width="4" Background="{Binding ElementName=itemFlipView,Path=SelectedIndex,Converter={StaticResource BorderMenuConverter},ConverterParameter=4}"></Border>
        </StackPanel>
        <FlipView x:Name="itemFlipView"
                  Grid.RowSpan="2"
                  Grid.Column="2"
                  ItemsSource="{Binding PromotionalAppData}"
                  PointerPressed="itemFlipView_PointerPressed"
                  PointerEntered="itemFlipView_PointerEntered"
                  PointerExited="itemFlipView_PointerExited">
            <FlipView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Vertical" />
                </ItemsPanelTemplate>
            </FlipView.ItemsPanel>
            <FlipView.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Image Grid.Row="0"
                               Source="{Binding AppView.ScreenshotUrls}"
                               Width="683"
                               Height="384"
                               VerticalAlignment="Top" />

                        <Grid Grid.Row="1"
                              VerticalAlignment="Top"
                              HorizontalAlignment="Left">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
                            <Border Background="#205B96" Width="150" Height="150" Margin="80,-50,0,0">
                                <Image Source="{Binding AppView.LogoUrl_150x150,Converter={StaticResource IsShowDefaultPicConverter},ConverterParameter=/Images/default_150_150.png}"
                                   Width="150"
                                   Height="150"
                                   />
                            </Border>
                            <StackPanel Grid.Column="1"
                                        Orientation="Vertical"
                                        Margin="30,15,0,0">
                                <TextBlock x:Name="pageTitle"
                                           Text="{Binding AppView.ApplicationName}"
                                           Style="{StaticResource HeaderTextBlockStyle}"
                                           FontSize="20"
                                           FontWeight="Bold"
                                           Margin="0,0,0,0"
                                           IsHitTestVisible="false"
                                           TextWrapping="NoWrap"
                                           VerticalAlignment="Center" />
                                <TextBlock Style="{StaticResource ItemDetailPage_explain_TextStyle}"
                                           Margin="0,10,0,0">
                                    <Run Text="{Binding AppView.CategoryText}"></Run>
                                </TextBlock>
                            </StackPanel>

                        </Grid>
                    </Grid>
                </DataTemplate>
            </FlipView.ItemTemplate>
        </FlipView>
    </Grid>
</UserControl>
